import Vue from 'vue'
import App from './App.vue'
import Router from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './css/prism.css'
import VueI18n from 'vue-i18n'
import Http from './js/http.js'
import Util from './js/util.js'

Vue.use(Router);
Vue.use(VueI18n);
Vue.use(Util);
Vue.use(ElementUI);
Vue.use(Http,"/jrcWebServer");


import Index from './router/Index.vue'
import Setting from './router/Setting.vue'
import ConfigList from './router/ConfigList.vue'
import ConfigVersionList from './router/ConfigVersionList.vue'
import ConfigDetail from './router/ConfigDetail.vue'
import AddRepository from './router/AddRepository.vue'
import SelectConfig from './component/SelectConfig.vue'


const routes = [
  {path : "/" , component : App , children : [
      {path : "/" , component : Index},
      {path : "/configList" , component : ConfigList},
      {path : "/setting" , component : Setting},
      {path : "/configVersionList" , component : ConfigVersionList},
      {path : "/configDetails" , component : ConfigDetail},
      {path : "/configDetails/:id" , component : ConfigDetail},
      {path : "/addRepository" , component : AddRepository},
      {path : "/selectConfig" , component : SelectConfig},
    ]}
];

const i18n = new VueI18n({
  locale: 'zh-cn',
  messages: {
    'zh-cn': require('./local/language-zh.js'),   // 中文语言包
    'en': require('./local/language-en.js')    // 英文语言包
  },
});

const router = new Router({
  routes : routes
});


new Vue({
  el: '#app',
  router : router,
  i18n : i18n,
});
